package com.huibo.aigou.plat.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.huibo.aigou.base.bo.AjaxResult;
import com.huibo.aigou.plat.domain.User;

@RestController
public class PlatController {	
	
	@PostMapping("/login")
	public AjaxResult login(@RequestBody User user) {
		if(user.getName().equals("admin") && user.getPass().equals("123321")) {
			return AjaxResult.createInstance().setMsg("登录成功").setData(new User("admin","123321"));
		}
		return AjaxResult.createInstance().setMsg("用户名或则密码错误").setCode(500);
	}
	
	@GetMapping("/test")
	public String test() {
		return "测试";
	}
}
